<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>柱状分布图</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>柱状图</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="graph_flot.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="graph_flot.html#">选项1</a>
                            </li>
                            <li><a href="graph_flot.html#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="echarts" style="height: 1500px;" id="echarts-bar-chart"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>



<!-- ECharts -->
<script src="js/plugins/echarts/echarts.min.js"></script>

<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>


<!-- ECharts demo data -->
<!--<script src="js/demo/echarts-demo.js"></script>-->
<script>
    var barChart = echarts.init(document.getElementById("echarts-bar-chart"));
    var data_1 = [Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000),
    Math.round(Math.random()*1000)];
    var data_2 = [Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000),
        Math.round(Math.random()*1000)];
    var data_3 = [Math.round(Math.random()*1000),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100),
        Math.round(Math.random()*100)];
    var city=['北京',
        '天津',
        '上海',
        '重庆',
        '河北',
        '河南',
        '云南',
        '辽宁',
        '黑龙江',
        '湖南',
        '安徽',
        '山东',
        '新疆',
        '江苏',
        '浙江',
        '江西',
        '湖北',
        '广西',
        '甘肃',
        '山西',
        '内蒙古',
        '陕西',
        '吉林',
        '福建',
        '贵州',
        '广东',
        '青海',
        '西藏',
        '四川',
        '宁夏',
        '海南',
        '台湾',
        '香港',
        '澳门'];
    var option = {
        title: {
            text: '全国投稿情况分布',
            subtext: '统计至当前日期'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {
            data: ['地区投稿量','作品入围数量','往届获奖情况']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            type: 'category',
            data: city
        },
        series: [
            {
                name: '地区投稿量',
                type: 'bar',
                data: data_1
            },
            {
                name: '作品入围数量',
                type: 'bar',
                data: data_2
            },
            {
                name: '往届获奖情况',
                type: 'bar',
                data: data_3
            }
        ]
    };

    var baroption = {
        title : {
            text: '全国投稿情况分布'
        },
        tooltip : {
            trigger: 'axis'
        },
        legend: {
            data:['地区投稿量','作品入围数量','往届获奖情况']
        },
        grid:{
            x:30,
            x2:40,
            y2:24
        },
        calculable : true,
        xAxis : [
            {
                type : 'category',
                data : city
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {
                name:'地区投稿量',
                type:'bar',
                data:data_1,
                markPoint : {
                    data : [
                        {type : 'max', name: '最大值'},
                        {type : 'min', name: '最小值'}
                    ]
                },
                markLine : {
                    data : [
                        {type : 'average', name: '平均值'}
                    ]
                }
            },
            {
                name:'作品入围数量',
                type:'bar',
                data:data_2,
                markPoint : {
                    data : [
                        {name : '年最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
                        {name : '年最低', value : 2.3, xAxis: 11, yAxis: 3}
                    ]
                },
//                markLine : {
//                    data : [
//                        {type : 'average', name : '平均值'}
//                    ]
//                }
            },
            {
                name:'往届获奖情况',
                type:'bar',
                data:data_3,
                markPoint : {
                    data : [
                        {name : '年最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
                        {name : '年最低', value : 2.3, xAxis: 11, yAxis: 3}
                    ]
                },
                markLine : {
                    data : [
                        {type : 'average', name : '平均值'}
                    ]
                }
            }
        ]
    };
    barChart.setOption(option);

    window.onresize = barChart.resize;
</script>
</body>

</html>
